<!DOCTYPE html>
<!--招聘信息的审核-->
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <title>Title</title>
</head>
<body>
<div class='layui-fiuld'>
    <div class='layui-row'>
        <div class='layui-col-md10 '>

            <table class='layui-table' id="needs" lay-filter="ad_needs"></table>
        </div>
    </div>
</div>
</body>
<script type="text/html" id="stateSwitch">
<input type="checkbox" name="state"  value={{d.state}}
       lay-skin="switch" lay-text="可用|锁定" mid={{d.demandId}}}
       lay-filter="stateCheck" {{ d.status == 0 ? 'checked' : '' }}/>

</script>
<script src="layui/layui.js" type='text/javascript'></script>
<script>
    layui.use(['table','form','layer'],function (){
        var table=layui.table;
        var form=layui.form;
        var layer=layui.layer;
        var $=layer.$;
        table.render({
            id:"Adneed",
            elem:'#needs',
            method:'POST',
            title:"招聘信息审核",
            url:'/demand/viewAllDemand',
            cellMinWidth: 80,
            response:{
                statusName:"code",
                statusCode:200

            },
            parseData:function(res){//信息的整合

                return{
                    "code":res.code,
                    "msg":res.msg,
                    "count":res.data.demands.size,
                    "data":res.data.demands
                };
            },
            page:false,
            totalRow:true,
            skin:'nob',
            even:true,
            size:"sm",
            toolbar:true,
            defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips'
            }],
            cols:[[
                {fixed:'left',type:'checkbox'},
                {field:'entepriseId',title:'企业代码',width:100},
                {field:'demandId',title:'需求代码',width:100},
                {field:'dname',title:'需求职位',width:100},
                {field:'need',title:'需求数',width:100},
                {field:'education',title:'学历要求;',width:100},
                {field:'college',title:'面向学院',width:100,
                templet:function (d){
                    return d.college.split('_')[0];
                }},
                {field:"major",title:"需求专业",width:100},
                {field:"salary",title:"月薪待遇",width:100},
                {field:'state', title:"状态", width:85,
                    templet: '#stateSwitch', unresize: true}
            ]],
            done:function(res,curr,count){
                exportData=res.data;//获取数据表格的中的数据
            }
        });
        table.on('tool(ad_enters)',function (obj){
            var data=obj.data;

            if(obj.event=='showImg'){
                var $=layui.$;
                var img_src = $('.dialog').attr('src');//依赖jquery的解释
                var img = "<img src='" + img_src + "'/>";
                layer.open({
                    type: 1,
                    title: '营业执照',
                    maxmin: true,
                    anim: 4,
                    content: img
                });


            }

        });

    });
</script>
<style>
    .layui-table-cell{
        height: auto;/*图片高度自定义*/
        line-height:50px;
    }

</style>
</html>